from api.base import Base
import unittest
from HTMLTestRunner import HTMLTestRunner
from setting import TEST_RESPORT
from loguru import logger


if __name__ == '__main__':

    base = Base()
    base.login()

    # 生成日志
    logger.add('logs/litemall.log')


    # 创建套件
    suite = unittest.TestLoader().discover('cases','test*.py')

    # 生成测试报告
    with open(TEST_RESPORT,'wb') as f:
        runner = HTMLTestRunner(f,title='wshop测试报告',description='v1')
        runner.run(suite)


